package com.alongstudio.account.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alongstudio.account.commons.exception.BusinessException;
import com.alongstudio.account.dao.IClientUserDao;
import com.alongstudio.account.entity.ClientUser;
import com.alongstudio.account.service.IClientUserService;

//@Transactional
@Service(value="ClientUserService")
public class ClientUserService extends BaseService implements IClientUserService {

	@Autowired
	private IClientUserDao userDao;
	
	@Override
	public ClientUser findUserByName(String userName) throws BusinessException {
		ClientUser user = null;
//		try {
//			List list = dao.query("select * from tbl_user");
//			System.out.println(list.size());
//		}
//		catch (Exception e) {
//			throw new BusinessException(thisClassName, e);
//		}
		return user;
	}

	@Override
	public List<ClientUser> findUserByPage(Map param, int start, int pageSize) throws BusinessException {
		List<ClientUser> users = null;
//		try {
//			users = dao.query("from ClientUser u order by u.id");
//		}
//		catch (Exception e) {
//			throw new BusinessException(thisClassName, e);
//		}
		return users;
	}

	@Override
	public ClientUser checkUserLogin(String userName, String password) throws BusinessException {
		return  userDao.checkUserLogin(userName, password);
	}

}
